package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.dto.ChangeDto;
import com.ruoyi.common.core.domain.dto.ChangeResultDto;
import com.ruoyi.common.core.domain.dto.TjlResultDto;
import com.ruoyi.common.core.domain.entity.TjlResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ITjlResultService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @DATE : 2024/07/01 16:20
 */
@RestController
@RequestMapping("/system/tjlResult")
public class TjlResultController {

    @Resource
    private ITjlResultService service;

    @PostMapping("/list")
    public AjaxResult list(@RequestBody TjlResultDto tjlResultDto)
    {
        return AjaxResult.success(service.list(tjlResultDto));
    }

    @PostMapping("/export")
    public void export(HttpServletResponse response, TjlResultDto tjlResultDto)
    {
        List<TjlResult> resultList = service.list(tjlResultDto);
        ExcelUtil<TjlResult> util = new ExcelUtil<TjlResult>(TjlResult.class);
        util.exportExcel(response, resultList, "模糊控制结果");
    }
}
